{template 'common/header'}
{if $operation == 'display'}
<div class="panel panel-info" style="margin-top: 10px;">
	<div class="panel-heading">搜索</div>
	<div class="panel-body">
		<form action="./index.php" method="get" class="form-horizontal" role="form" id="form1">
			<input type="hidden" name="c" value="site" />
			<input type="hidden" name="a" value="entry" />
			<input type="hidden" name="m" value="hellozjx_mapwxapp" />
			<input type="hidden" name="do" value="user" />
			<div class="form-group">
				<label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">关键字</label>
				<div class="col-sm-8 col-lg-9 col-xs-12">
					<input class="form-control" name="search_phone" style="width:30%;float:left;margin-right:3%;" id="" type="text" value="{$_GPC['search_phone']}" placeholder="输入用户手机号">
					<input class="form-control" name="search_nickname" style="width:30%;float:left;margin-right:3%;" type="text" value="{$_GPC['search_nickname']}" placeholder="输入用户昵称">
					<select name="search_status" style="width:30%;float:left;">
						<option value="0">--请选择--</option>
						<option {if $_GPC['search_status'] == 1}selected{/if} value="1">正常</option>
						<option {if $_GPC['search_status'] == 2}selected{/if} value="2">已禁用</option>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label"></label>
				<div class="col-sm-5 col-xs-12">
					<button class="btn btn-success"><i class="fa fa-search"></i> 搜索</button>
				</div>
			</div>
		</form>
	</div>
</div>
<div class="main panel panel-default">
	<div class="panel-body table-responsive">
		<table class="table table-hover">
			<thead class="navbar-inner">
				<tr>
					<th style="width:30px;">ID</th>
					<th style="text-align: center;">头像</th>
					<th style="text-align: center;">真实姓名</th>
					<th style="text-align: center;">昵称</th>
					<th style="text-align: center;">手机号</th>
					<th style="text-align: center;">状态</th>
					<th style="text-align: center;">操作</th>
				</tr>
			</thead>
			<tbody>
				{loop $list $item}
				<tr>
					<td style="vertical-align: inherit;">{$item['id']}</td>
					<td style="text-align: center;vertical-align: inherit;"><img width="100" src="{php echo tomedia($item['avatar'])}" alt=" "></td>
					<td style="text-align: center;vertical-align: inherit;">{$item['real_name']}</td>
					<td style="text-align: center;vertical-align: inherit;">{$item['nick_name']}</td>
					<td style="text-align: center;vertical-align: inherit;">{$item['phone']}</td>
					<td style="text-align: center;vertical-align: inherit;">{if ($item['status'] == 1)}正常{else}已禁用{/if}</td>
					<td style="text-align:center;font-size: 10px;vertical-align: inherit;">
						<a href="{php echo $this->createWebUrl('user', array('op' => 'post', 'id' => $item['id']))}" class="btn btn-default btn-sm" data-toggle="tooltip" data-placement="top" title="修改"><i class="fa fa-edit"></i></a>
						<a href="{php echo $this->createWebUrl('user', array('op' => 'delete', 'id' => $item['id']))}" onclick="return confirm('确认删除吗？');return false;" class="btn btn-default btn-sm" data-toggle="tooltip" data-placement="top" title="删除"><i class="fa fa-times"></i></a>
					</td>
				</tr>
				{/loop}
			</tbody>
		</table>
		{$pager}
	</div>
</div>
{elseif $operation == 'post'}

<div class="main">
	<form action="" method="post" class="form-horizontal form" enctype="multipart/form-data" onsubmit='return formcheck()'>
		<input type="hidden" name="id" value="{$user['id']}" />
		<div class="panel panel-default">
			<div class="panel-heading">
				会员设置
			</div>
			<div class="panel-body">
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label"><span style="color:red">*</span>真实姓名</label>
					<div class="col-sm-9 col-xs-12">
						<input type="text" class="form-control" value="{$user['real_name']}" readonly="readonly" disabled="disabled" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label"><span style="color:red">*</span>昵称</label>
					<div class="col-sm-9 col-xs-12">
						<input type="text" class="form-control" value="{$user['nick_name']}" readonly="readonly" disabled="disabled" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label"><span style="color:red">*</span>头像</label>
					<div class="col-sm-9 col-xs-12">
						<img width="100" src="{php echo tomedia($item['avatar'])}" alt=" ">
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label"><span style="color:red">*</span>性别</label>
					<div class="col-sm-9 col-xs-12">
						<label class='radio-inline'>
							<input type='radio' disabled="disabled" readonly="readonly" value='1' {if $user['status']==1}checked{/if} /> 是
						</label>
						<label class='radio-inline'>
							<input type='radio' disabled="disabled" readonly="readonly" value='2' {if $user['status']==2}checked{/if} /> 否
						</label>
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label"><span style="color:red">*</span>手机号</label>
					<div class="col-sm-9 col-xs-12">
						<input type="text" class="form-control" value="{$user['phone']}" readonly="readonly" disabled="disabled" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label"><span style="color:red">*</span>邮箱</label>
					<div class="col-sm-9 col-xs-12">
						<input type="text" class="form-control" value="{$user['email']}" readonly="readonly" disabled="disabled" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label"><span style="color:red">*</span>住址</label>
					<div class="col-sm-9 col-xs-12">
						<input type="text" class="form-control" value="{$user['address']}" readonly="readonly" disabled="disabled" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label">是否启用</label>
					<div class="col-sm-9 col-xs-12">
						<label class='radio-inline'>
							<input type='radio' name='status' value='1' {if $user['status']==1}checked{/if} /> 是
						</label>
						<label class='radio-inline'>
							<input type='radio' name='status' value='2' {if $user['status']==2}checked{/if} /> 否
						</label>
					</div>
				</div>
			</div>
		</div>
		<div class="form-group col-sm-12">
			<input type="submit" name="submit" value="提交" class="btn btn-primary col-lg-1" />
			<input type="hidden" name="token" value="{$_W['token']}" />
		</div>
	</form>
</div>

<script language='javascript'>
	function formcheck() {
		if ($("#area_name").val() == '') {
			util.message("请填写分类名称");
			return false;
		}
		return true;
	}
</script>
{/if}
{template 'common/footer'}